package com.shell.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.shell.bee.base.utils.SpringContextUtil;
import com.shell.customer.chain.callback.CallbackService;
import com.shell.customer.chain.callback.service.CustChainCallbackService;
import com.shell.customer.chain.callback.service.impl.CustChainCallbackServiceImpl;

@Configuration
public class CallbackConfig
{
  @Bean
  public CustChainCallbackService chainCallbackService()
  {
    String[] beans = { "groupCancelCallbackService" };
    
    List<CallbackService> services = new ArrayList<CallbackService>();
    for (String bean : beans) {
      services.add((CallbackService)SpringContextUtil.getBean(bean));
    }
    Object chainCallbackService = new CustChainCallbackServiceImpl(services);
    return (CustChainCallbackService)chainCallbackService;
  }
}
